﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using AspNetCs.Common;
using AspNetCs.Bll;

public partial class PartsOfNetMuList : BasePage
{
    private int pageSize = 20;
    protected int recodCount = 0;
    private int province = 0;
    private int city = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        DnsRequest.UrlRequestAgentName(out city, out province);
        if (!IsPostBack)
        {
            //province = StringHelper.isNumber_int(Request["province"]);
            //city = StringHelper.isNumber_int(Request["city"]);
            //ViewState["province"] = province;
            //ViewState["city"] = city;
            BindReapter();
        }
        else
        {
            //if (ViewState["province"] != null)
            //{
            //    province = StringHelper.isNumber_int(ViewState["province"].ToString());
            //}
            //if (ViewState["city"] != null)
            //{
            //    city = StringHelper.isNumber_int(ViewState["city"].ToString());
            //}
        }
    }


    public void BindReapter()
    {
        string cmdText = "select id,MuId,MuName,createname=(select username from users where userid=me.CreateId ),CreateDate,hot from NetMu as me where IsCheck=1 and Isdel=0 and province=" + this.province + " and city=" + this.city + " order by hot desc";
        DataPagesOperate operate = new DataPagesOperate();
        AspNetPager1.PageSize = pageSize;
        operate.BindRepeater(cmdText, AspNetPager1, "hot desc", "id", rptList, out recodCount);

    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindReapter();
    }
}
